package com.circle.rest.core.exception;

import lombok.Getter;
import lombok.Setter;

/**
 * @program: RestfulApi
 * @description: 业务异常
 * @author: 赵航
 * @create: 2019-03-07 10:02
 **/
@Getter
@Setter
public class ServiceException extends RuntimeException {
    private Integer code;

    public ServiceException(String msg) {
        super(msg);
    }

    public ServiceException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }

    public ServiceException(ExceptionEnum exceptionEnum){
        super(exceptionEnum.msg());
        this.code = exceptionEnum.code();
    }
}
